//
//  CheekFountionView.m
//  CheekiOS
//
//  Created by mac on 2017/7/13.
//  Copyright © 2017年 mac. All rights reserved.
//

#import "CheekFountionView.h"

@implementation CheekFountionView

- (instancetype)init {
    self = [super init];
    if (self) {
        [self addSubViews];
        
        
        self.backgroundColor = [UIColor clearColor];
    }
    return self;
}

- (instancetype)initWithFrame:(CGRect)frame {
    self = [super initWithFrame:frame];
    if (self) {
        [self addSubViews];
        
        
        self.backgroundColor = [UIColor clearColor];
    }
    return self;
}

- (instancetype)initWithCoder:(NSCoder *)aDecoder {
    self = [super initWithCoder:aDecoder];
    if (self) {
        [self addSubViews];
        
        
        self.backgroundColor = [UIColor clearColor];
    }
    return self;
}

-(void)addSubViews{

    _SkincareBtn = [[UIButton alloc] init];
    [_SkincareBtn setImage:[UIImage imageNamed:@"viedo_filter_icon"] forState:UIControlStateNormal];
    [_SkincareBtn addTarget:self action:@selector(BeautyButtonClick) forControlEvents:UIControlEventTouchUpInside];
    [_SkincareBtn setFrame:CGRectMake(20*SCREEN_WIDTH_RATIO47, 0, 50*SCREEN_WIDTH_RATIO47, 50*SCREEN_WIDTH_RATIO47)];
    [self addSubview:_SkincareBtn];
    
    
    _giftBtn = [[UIButton alloc] init];
    [_giftBtn setImage:[UIImage imageNamed:@"viedo_gift_icon"] forState:UIControlStateNormal];
    [_giftBtn addTarget:self action:@selector(CreateGiftBtnClick) forControlEvents:UIControlEventTouchUpInside];
    [_giftBtn setFrame:CGRectMake(_SkincareBtn.right+25*SCREEN_WIDTH_RATIO47, 0, 50*SCREEN_WIDTH_RATIO47, 50*SCREEN_WIDTH_RATIO47)];
    [self addSubview:_giftBtn];
    
    
    _closeBtn = [[UIButton alloc] init];
    [_closeBtn setImage:[UIImage imageNamed:@"viedo_close_icon"] forState:UIControlStateNormal];
    [_closeBtn addTarget:self action:@selector(quitRommType:) forControlEvents:UIControlEventTouchUpInside];
    [_closeBtn setFrame:CGRectMake(self.width-75*SCREEN_WIDTH_RATIO47, 0, 50*SCREEN_WIDTH_RATIO47, 50*SCREEN_WIDTH_RATIO47)];
    [self addSubview:_closeBtn];
    
    _refreshBtn = [[UIButton alloc] init];
    [_refreshBtn setImage:[UIImage imageNamed:@"viedo_refresh_icon"] forState:UIControlStateNormal];
    [_refreshBtn addTarget:self action:@selector(refreshBtnAction) forControlEvents:UIControlEventTouchUpInside];
    _refreshBtn.frame = CGRectMake(self.width-75*SCREEN_WIDTH_RATIO47-_closeBtn.width-25*SCREEN_WIDTH_RATIO47, 0, 50*SCREEN_WIDTH_RATIO47, 50*SCREEN_WIDTH_RATIO47);
    [self addSubview:_refreshBtn];
}


- (void)quitRommType:(UIButton *)sender{
    
    if ([self.delegate respondsToSelector:@selector(quitRommType:)]) {
        [self.delegate quitRommType:sender];
    }

}

- (void)refreshBtnAction{
    
    if ([self.delegate respondsToSelector:@selector(refreshBtn)]) {
        [self.delegate refreshBtn];
    }

}

-(void)CreateGiftBtnClick{

    if ([self.delegate respondsToSelector:@selector(CreateGiftBtnClick)]) {
        [self.delegate CreateGiftBtnClick];
    }
    
}

- (void)BeautyButtonClick{
    if ([self.delegate respondsToSelector:@selector(BeautyButtonClick)]) {
        [self.delegate BeautyButtonClick];
    }
    

}

@end
